Refactor the process updates functions to share code between them. Also
authorRichard Hult <richard@imendio.com>
Wed, 18 Apr 2007 20:09:55 +0000 (20:09 +0000)
committerRichard Hult <rhult@src.gnome.org>
Wed, 18 Apr 2007 20:09:55 +0000 (20:09 +0000)
2007-04-18  Richard Hult  <richard@imendio.com>

* gdk/quartz/gdkwindow-quartz.c:
(gdk_window_quartz_process_updates_internal),
(gdk_window_quartz_process_all_updates),
(gdk_window_impl_quartz_process_updates): Refactor the process
updates functions to share code between them. Also fixes bug
#427660 by not updating larger regions than necessary.

svn path=/trunk/; revision=17610

ChangeLog
gdk/quartz/gdkwindow-quartz.c

index 1ab825dc70298d1cb587f325eb16e3392c3cc6a8..1bcb9fecad5ccdb69e183c971b5d943a229d2e4a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2007-04-18  Richard Hult  <richard@imendio.com>
+
+       * gdk/quartz/gdkwindow-quartz.c:
+       (gdk_window_quartz_process_updates_internal),
+       (gdk_window_quartz_process_all_updates),
+       (gdk_window_impl_quartz_process_updates): Refactor the process 
+       updates functions to share code between them. Also fixes bug 
+       #427660 by not updating larger regions than necessary.
+
 2007-04-18  Matthias Clasen  <mclasen@redhat.com>
 
        * gdk/gdkregion-generic.h (GROWREGION): Handle the case
index 3b937104410eb32d8d093f06c6ae8e324cc3c5e1..93b2f218e87e9dca6eb8160b3a8bb8df18226b04 100644 (file)
@@ -252,6 +252,34 @@ gdk_window_impl_quartz_end_paint (GdkPaintable *paintable)
     }
 }
 
+static void
+gdk_window_quartz_process_updates_internal (GdkWindow *window)
+{
+  GdkWindowObject *private = (GdkWindowObject *) window;
+  GdkWindowImplQuartz *impl = (GdkWindowImplQuartz *) private->impl;
+      
+  if (private->update_area)
+    {
+      int i, n_rects;
+      GdkRectangle *rects;
+
+      gdk_region_get_rectangles (private->update_area, &rects, &n_rects);
+
+      gdk_region_destroy (private->update_area);
+      private->update_area = NULL;
+
+      for (i = 0; i < n_rects; i++) 
+       {
+         [impl->view setNeedsDisplayInRect:NSMakeRect (rects[i].x, rects[i].y,
+                                                       rects[i].width, rects[i].height)];
+       }
+
+      [impl->view displayIfNeeded];
+
+      g_free (rects);
+    }
+}
+
 static void
 gdk_window_quartz_process_all_updates (void)
 {
@@ -267,28 +295,7 @@ gdk_window_quartz_process_all_updates (void)
 
   while (tmp_list)
     {
-      GdkWindowObject *private = tmp_list->data;
-      GdkWindowImplQuartz *impl = (GdkWindowImplQuartz *) private->impl;
-      int i, n_rects;
-      GdkRectangle *rects;
-      
-      if (private->update_area)
-       {
-         gdk_region_get_rectangles (private->update_area, &rects, &n_rects);
-
-         gdk_region_destroy (private->update_area);
-         private->update_area = NULL;
-         
-         for (i = 0; i < n_rects; i++) 
-           {
-             [impl->view setNeedsDisplayInRect:NSMakeRect (rects[i].x, rects[i].y,
-                                                           rects[i].width, rects[i].height)];
-           }
-         
-         [impl->view displayIfNeeded];
-
-         g_free (rects);
-       }
+      gdk_window_quartz_process_updates_internal (tmp_list->data);
 
       g_object_unref (tmp_list->data);
       tmp_list = tmp_list->next;
@@ -350,12 +357,9 @@ gdk_window_impl_quartz_process_updates (GdkPaintable *paintable,
 
   if (private->update_area)
     {
-      gdk_region_destroy (private->update_area);
-      private->update_area = NULL;
-    }  
-
-  [impl->view setNeedsDisplay: YES];
-  update_windows = g_slist_remove (update_windows, private);
+      gdk_window_quartz_process_updates_internal ((GdkWindow *) private);
+      update_windows = g_slist_remove (update_windows, private);
+    }
 }
 
 static void